package com.itheima.autoconfig.properties;

import com.baidu.aip.face.AipFace;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

@ConfigurationProperties(prefix = "tanhua.aip")
@Data
public class AipProperties {

    private String appId;
    private String appKey;
    private String secretKey;

    @Bean
    public AipFace aipFace(){
        // 初始化一个AipFace
        AipFace client = new AipFace(appId,appKey,secretKey);
        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(200000);
        client.setSocketTimeoutInMillis(600000);
        return client;
    }

}
